package com.ruyuan.eshop.common.domain.entity;

import com.ruyuan.eshop.framework.domain.entity.BaseEntity;
import com.ruyuan.eshop.framework.utils.DateUtil;
import com.ruyuan.eshop.common.enums.PayStatusEnum;
import lombok.Data;

import javax.validation.constraints.NotEmpty;


/**
 * 充值记录实体
 *
 * @author pwd
 * @version 1.0
 */
@Data
public class RechargeDO extends BaseEntity {

    /**
     * 充值订单编号
     */
    private String rechargeSn;

    /**
     * 会员id
     */
    private Long memberId;

    /**
     * 会员名称
     */
    private String memberName;

    /**
     * 充值金额
     */
    @NotEmpty(message = "充值金额不能为空")
    private Double rechargeMoney;

    /**
     * 充值时间戳
     */
    private Long rechargeTime;

    /**
     * 充值方式，如：支付宝，微信
     */
    private String rechargeWay;

    /**
     * 支付状态
     */
    private String payStatus;

    /**
     * 支付插件id
     */
    private String paymentPluginId;

    public RechargeDO() {
    }

    public RechargeDO(String rechargeSn, Long memberId, String memberName, @NotEmpty(message = "充值金额不能为空") Double rechargeMoney) {
        this.rechargeSn = rechargeSn;
        this.memberId = memberId;
        this.memberName = memberName;
        this.rechargeMoney = rechargeMoney;
        this.payStatus = PayStatusEnum.PAY_NO.name();
        this.rechargeTime = DateUtil.getDateline();

    }


}
